declare interface Window {
    changeMusic: (el: HTMLDivElement) => void;
}
window.addEventListener("load", function () {
    const muBut = this.document.querySelector("#muBut") as HTMLDivElement
    var initial = function () {
        document.getElementsByTagName("audio")[0].play();
        document.body.removeEventListener("click", initial);
    };
    document.body.addEventListener("click", initial);

    window.changeMusic = function (el) {
        document
            .getElementsByTagName("audio")[0]
        [
            document.getElementsByTagName("audio")[0].paused
                ? "play"
                : "pause"
        ]();
    };

    document
        .getElementsByTagName("audio")[0]
        .addEventListener("play", function () {
            muBut.setAttribute("style", "animation-play-state:running");
        });

    document
        .getElementsByTagName("audio")[0]
        .addEventListener("pause", function () {
            muBut.setAttribute("style", "animation-play-state:paused");
        });
});